package com.mt.channel.controller;

import com.mt.channel.api.service.IChannelMsgService;
import com.mt.channel.entity.ChannelMsgEntity;
import com.mt.common.PagerInfo;
import com.mt.common.ServiceResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
@CrossOrigin
@RestController
public class ChannelMsgController {
    @Autowired
    IChannelMsgService channelMsgService;

    @GetMapping("/channelMsg/findList")
    public ServiceResult<List<ChannelMsgEntity>> findList(Map<String, Object> params, PagerInfo<?> pagerInfo) {
        return channelMsgService.findList(params, pagerInfo);
    }

    @GetMapping("/channelMsg/findInfo")
    public ServiceResult<ChannelMsgEntity> findInfo(Map<String, Object> params) {
        return channelMsgService.findInfo(params);
    }

    @PostMapping("/channelMsg/changeStatus")
    public ServiceResult<Integer> doUpdate(ChannelMsgEntity channelMsgEntity) {
        return channelMsgService.doUpdate(channelMsgEntity);
    }
}
